<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        let a3 = Array.of(10, "你好");
        console.log(a3);

        let obj = {
            name: "abc",
            aga: "def",
            2: "789",
            3: "转数组必须有序号，0，1，2，3否则undefined",
            4: "数组length长度大于本身长度undefined",
            length: 7
        }


        console.log(Array.from(obj));

        let a1 = 10;
        function fn() {
            // let a1 = 20;
            console.log(a1);
        }
        fn();

        // const q = 3;
        let q = 3;
        q = 4;
        console.log(q)

    </script>


    <script>
        let a = Array.of(1, "张三", "abc");
        console.log(a);


        // 结构上形似数组的对象被称为伪数组
        let obj1 = {
            0: 1,
            1: "张三",
            2: "abc",
            3: "abc",
            length: 4
        }
        console.log(obj1)

        let b = Array.from(obj1);
        console.log(b)
        // 判断是不是数组
        console.log(b instanceof Array);
        console.log(a instanceof Array);


        let arr1 = [1, 2, 3, 4, 5, 8, 7];
        // let arr1 = ["1,2,3,4,5,8,7",2,"张三"];

        console.log(arr1);
        let s = arr1.find(function (item, idx, arr) {
            // return item == "张三q";
            return item > 1;

            // return idx > 4;
        })

        //    console.log(s)

        let d = arr1.findIndex(function (item, idx, arr) {
            return item > 0
        })
        console.log(d);

        let arr2 = [1, 2, 3, 4, 5, 8, 7, a, a1, true,];
        let arr3 = arr2.includes(true);
        console.log(arr3);

        let b1 = {
            name: "张三"
        }

        let b2 = [
            {
                // name:"张三",
                // b1,
                xingbei: "男"
            },
            b1
        ]
        console.log(b2)
        console.log(b2.includes(b1));






    </script>
</body>

</html>